/**
 * 
 */
package org.dragonfire.parser.functions;

import org.dragonfire.parser.Equation;

/**
 * @author Darth Android
 * @date Jul 30, 2006
 */
public class Rand extends Function {

	public String eval(Equation equ, String[] params) {
		if (params.length < 2)
			return Math.random() + "";
		double min = Double.parseDouble(params[0]);
		double max = Double.parseDouble(params[1]);
		return (Math.random() * (max - min)) + min + "";
	}

	public int minParams() {
		return 0;
	}
}
